package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Get extends HttpServlet {
  private String user;

	@Override
public void init() throws ServletException {
	System.out.println("初始化......");
	super.init();
}

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("doGet");
		String userName=req.getParameter("userName");
		String password=req.getParameter("password");
		System.out.println(userName);
		System.out.println(password);
		resp.setContentType("heml");
		PrintWriter writer=resp.getWriter();
		writer.write("<h2>userName"+userName+"<h2>");
		writer.write("<h2>password"+password+"<h2>");
	}

	@Override
	public void destroy() {
		System.out.println("servlet销毁.......");
		super.destroy();
	}

}
